<?php

namespace app\admin\validate;

use think\Validate;

class Post extends Validate
{
    protected $rule = [
        'id' => 'require',
        'title' => 'require',
        'content' => 'require',
        'address' => 'require',
        'latitude' => 'require',
        'longitude' => 'require',
        'sort' => 'require',
        'status' => 'require',
    ];

    protected $scene = [
        'create'=>['title','content','sort','status','address','latitude','longitude'],
        'update'=>['id','title','content','sort','status','address','latitude','longitude'],
    ];

    protected $message = [
        'id' => 'ID不能为空',
        'title' => '名称不能为空',
        'content' => '内容不能为空',
        'sort' => '排序不能为空',
        'status' => '状态不能为空',
        'address' => '地址不能为空',
        'latitude' => '纬度不能为空',
        'longitude' => '经度不能为空',
    ];
}
